#ifndef CPP_TOOLS_DLOG_H
#define CPP_TOOLS_DLOG_H
#pragma once

#include "format.h"
#include "restream.h"

namespace util {
namespace dlog {

const char *only_filename_func(const char *pwd_filename);

} // namespace dlog
} // namespace util

#define D_DEBUG                                                                \
  if (true)                                                                    \
  util::dlog::restream::logger(util::dlog::only_filename_func(__FILE__),       \
                               __LINE__, 0)
#define D_INFO                                                                 \
  if (true)                                                                    \
  util::dlog::restream::logger(util::dlog::only_filename_func(__FILE__),       \
                               __LINE__, 1)
#define D_WARN                                                                 \
  if (true)                                                                    \
  util::dlog::restream::logger(util::dlog::only_filename_func(__FILE__),       \
                               __LINE__, 2)
#define D_ERROR                                                                \
  if (true)                                                                    \
  util::dlog::restream::logger(util::dlog::only_filename_func(__FILE__),       \
                               __LINE__, 3)

#endif